package com.esri.core.geometry;

import com.esri.core.geometry.Unit;

/* loaded from: classes.dex */
public class AngularUnit extends Unit {
    private static final long serialVersionUID = 1;

    /* loaded from: classes.dex */
    public interface Code {
        public static final int DEGREE = 9102;
        public static final int GON = 9106;
        public static final int GRAD = 9105;
        public static final int MICRORADIAN = 9109;
        public static final int MIL_6400 = 9114;
        public static final int MINUTE = 9103;
        public static final int MINUTE_CENTESIMAL = 9112;
        public static final int RADIAN = 9101;
        public static final int SECOND = 9104;
        public static final int SECOND_CENTESIMAL = 9113;
    }

    static native boolean nativeEquals(int i, int i2);

    static native String nativeGetAbbreviation(int i);

    static native String nativeGetDisplayName(int i);

    static native int nativeGetID(int i);

    static native String nativeGetName(int i);

    static native String nativeGetPluralDisplayName(int i);

    public AngularUnit(int i) {
        this.mWKID = i;
    }

    @Override // com.esri.core.geometry.Unit
    public String getName() {
        if (this.mName == null) {
            this.mName = nativeGetName(this.mWKID);
        }
        return this.mName;
    }

    @Override // com.esri.core.geometry.Unit
    public String getDisplayName() {
        if (this.mDisplayName == null) {
            this.mDisplayName = nativeGetDisplayName(this.mWKID);
        }
        return this.mDisplayName;
    }

    @Override // com.esri.core.geometry.Unit
    public String getPluralDisplayName() {
        if (this.mPluralDisplayName == null) {
            this.mPluralDisplayName = nativeGetPluralDisplayName(this.mWKID);
        }
        return this.mPluralDisplayName;
    }

    @Override // com.esri.core.geometry.Unit
    public String getAbbreviation() {
        if (this.mAbbreviation == null) {
            this.mAbbreviation = nativeGetAbbreviation(this.mWKID);
        }
        return this.mAbbreviation;
    }

    @Override // com.esri.core.geometry.Unit
    public int getID() {
        if (this.mID == -1) {
            this.mID = nativeGetID(this.mWKID);
        }
        return this.mID;
    }

    @Override // com.esri.core.geometry.Unit
    public double getConversionFactor(Unit unit) {
        if (unit.getUnitType() != Unit.UnitType.ANGULAR) {
            throw new GeometryException("invalid_call");
        }
        return getUnitToBaseFactor() / unit.getUnitToBaseFactor();
    }

    @Override // com.esri.core.geometry.Unit
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj instanceof AngularUnit) {
            return nativeEquals(this.mWKID, ((AngularUnit) obj).mWKID);
        }
        return false;
    }

    @Override // com.esri.core.geometry.Unit
    public Unit.UnitType getUnitType() {
        return Unit.UnitType.ANGULAR;
    }

    public double convertFromRadians(double d) {
        return d / getUnitToBaseFactor();
    }

    public double convertToRadians(double d) {
        return d * getUnitToBaseFactor();
    }
}
